package jvm;

import java.util.Base64;

public class HelloClassLoader extends ClassLoader {
    public static void main(String[] args) throws Exception {
        HelloClassLoader helloClassLoader = new HelloClassLoader();
        helloClassLoader.findClass("jvm.MyHello").newInstance();
    }

    @Override
    protected Class<?> findClass(String name) throws ClassNotFoundException {
        String baseCode = "yv66vgAAADQAHwoABgARCQASABMIABQKABUAFgcAFwcAGAEABjxpbml0PgEAAygpVgEABENvZGUBAA9MaW5lTnVtYmVyVGFibGUBABJMb2NhbFZhcmlhYmxlVGFibGUBAAR0aGlzAQANTGp2bS9NeUhlbGxvOwEACDxjbGluaXQ+AQAKU291cmNlRmlsZQEADE15SGVsbG8uamF2YQwABwAIBwAZDAAaABsBAAtIZWxsbyBXb3JsZAcAHAwAHQAeAQALanZtL015SGVsbG8BABBqYXZhL2xhbmcvT2JqZWN0AQAQamF2YS9sYW5nL1N5c3RlbQEAA291dAEAFUxqYXZhL2lvL1ByaW50U3RyZWFtOwEAE2phdmEvaW8vUHJpbnRTdHJlYW0BAAdwcmludGxuAQAVKExqYXZhL2xhbmcvU3RyaW5nOylWACEABQAGAAAAAAACAAEABwAIAAEACQAAAC8AAQABAAAABSq3AAGxAAAAAgAKAAAABgABAAAAAwALAAAADAABAAAABQAMAA0AAAAIAA4ACAABAAkAAAAlAAIAAAAAAAmyAAISA7YABLEAAAABAAoAAAAKAAIAAAAFAAgABgABAA8AAAACABA=";
        Base64.Decoder decoder = Base64.getDecoder();
        byte[] decode = decoder.decode(baseCode);
        return defineClass(name,decode,0,decode.length);
    }
}
